<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Grom Hellscream
 * Date: 11/2/12
 * Time: 11:33 AM
 * To change this template use File | Settings | File Templates.
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$type = JRequest::getInt('type', 0);
if (!JFactory::getUser()->authorise('vast.baocao.manage'))
{
    JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_vast&view=vast'));        
}

?>

<div id="crumbs">
    <div style="color: #222222;font-weight: normal;margin: 0;padding: 0">
        <a href="<?php echo JRoute::_('index.php?option=com_vast&view=vast') ?>">Trang chủ</a> »
        <span>Xác lập báo cáo</span>
    </div>
</div>

<div id="main" class="home">
    <h3 class="title green">Tạo một số mẫu báo cáo cho cán bộ lãnh đạo viện</h3>

    <div class="search-form">
        <div class="wide form">
            <form id="commentform" class="commentform" class="form-validate" method="post" action="index.php?option=com_vast&view=baocao">
            
                <div class="row">
                    <label style="text-align: left;">Loại báo cáo</label>		
                    <select style="width: 35%;" name="baocaoLoai" id="baocaoLoai">
                        <?php if (isset($type) && $type == 0): ?>
                            <option value="0" selected="selected">-Hãy chọn loại báo cáo-</option>
                        <?php else: ?>
                            <option value="0">-Hãy chọn loại báo cáo-</option>
                        <?php endif; ?>
                        <?php if (isset($type) && $type == 1): ?>
                            <option value="1" selected="selected">Danh sách cán bộ đến tuổi về hưu</option>
                        <?php else: ?>
                            <option value="1">Danh sách cán bộ đến tuổi về hưu</option>
                        <?php endif; ?>
                    </select>
                </div>
                
                <?php  
                    if (isset($type) && $type == 1):
                ?>
                
                <div class="row">
                    <label style="text-align: left;">Tuổi nam</label>		
                    <input size="60" maxlength="128" name="tuoiNam" id="tuoiNam" type="text" />	
                </div>
                
                <div class="row">
                    <label style="text-align: left;">Tuổi nữ</label>		
                    <input size="60" maxlength="128" name="tuoiNu" id="tuoiNu" type="text" />	
                </div>

                <?php
                    endif;
                ?>
                <div class="row buttons">
                    <input type="hidden" name="option" value="com_vast" />
                    <input type="hidden" name="view" value="baocao" />
                    <?php if (isset($type) && $type == 0): ?>
                    <input id="submit" value="Chọn báo cáo" type="submit"/>	
                    <input type="hidden" name="task" value="baocao.submit" />
                    <?php else: ?>
                    <input id="submit" value="Xuất báo cáo" type="submit"/>	
                    <input type="hidden" name="task" value="baocao.export" />
                    <?php endif; ?>
                    <?php echo JHtml::_('form.token'); ?>
                </div>
    
            </form>
        </div>
    </div>
    
    <div style="float: left; width: 680px; margin-top: 5px;">
        <?php
        $url = htmlspecialchars($_SERVER['HTTP_REFERER']);
        echo '<a title="Quay lại" href="' . $url . '"><span style="left: 610px; position: relative;">&laquo; Quay lại</span></a>';
        ?>    
    </div>    
</div>